
Vue.prototype.$mip = mip;
Vue.filter('dateTime',function(value) {
        var dateTime = new Date(parseInt(value * 1000));
        var Y = dateTime.getFullYear(),
            m = dateTime.getMonth() + 1,
            d = dateTime.getDate(),
            H = dateTime.getHours(),
            i = dateTime.getMinutes(),
            s = dateTime.getSeconds();
        if(m < 10) {
            m = '0' + m;
        }
        if(d < 10) {
            d = '0' + d;
        }
        if(H < 10) {
            H = '0' + H;
        }
        if(i < 10) {
            i = '0' + i;
        }
        if(s < 10) {
            s = '0' + s;
        }
        var t = Y + '-' + m + '-' + d;
        return t;
});

Vue.filter('time',function(value) {
        var dateTime = new Date(parseInt(value * 1000));
        var Y = dateTime.getFullYear(),
            m = dateTime.getMonth() + 1,
            d = dateTime.getDate(),
            H = dateTime.getHours(),
            i = dateTime.getMinutes(),
            s = dateTime.getSeconds();
        if(m < 10) {
            m = '0' + m;
        }
        if(d < 10) {
            d = '0' + d;
        }
        if(H < 10) {
            H = '0' + H;
        }
        if(i < 10) {
            i = '0' + i;
        }
        if(s < 10) {
            s = '0' + s;
        }
        var t = Y + '-' + m + '-' + d + " " + H + ':' + i + ':' + s;
        return t;
});